//
//  WKTableViewCell.m
//  WKDemo
//
//  Created by wjm on 14-8-4.
//  Copyright (c) 2014年 com.app. All rights reserved.
//

#import "WKTableViewCell.h"
#import "WKTopTableViewCell.h"
#import "WKTableViewCellFrame.h"
//#import "WKCellToolbar.h"
#import "WKStatusToolbar.h"
#import "WKStatusFrame.h"

@interface WKTableViewCell ()
//cell上部的view
@property (nonatomic, weak)WKTopTableViewCell *topView;
//cell下部的view
@property (nonatomic,weak)WKStatusToolbar *tool;

@end

@implementation WKTableViewCell

+(instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *ID = @"status";
    WKTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    
    if (!cell)
    {
        cell = [[WKTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return cell;
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //添加顶部View
        WKTopTableViewCell *top = [[WKTopTableViewCell alloc]init];
        [self.contentView addSubview:top];
        self.topView = top;
        self.backgroundColor = [UIColor clearColor];
        //底部工具条
        WKStatusToolbar *tool = [[WKStatusToolbar alloc]init];
        [self.contentView addSubview:tool];
        self.tool = tool;
    }
    return self;
}

- (void)setHeight:(CGFloat)height
{
    
}

- (void)setTableCellFrame:(WKTableViewCellFrame *)tableCellFrame
{
    _tableCellFrame = tableCellFrame;
    self.frame = tableCellFrame.cellRect;
    self.topView.TopFrame = tableCellFrame.TopFrame;
    self.tool.frame = tableCellFrame.TopFrame.userBootFrame;
    //    self.conView.frame = tableCellFrame.conFrame.frame;
}

@end
